<!DOCTYPE html>
<html>
<head>
    <title></title>
    #parse("sys/header.html")
    <style>
        .ivu-steps {
            margin-top: 20px;
            margin-bottom: 15px;
            margin-left: 15px;
        }
        .upload-list {
            display: inline-block;
            width: 60px;
            height: 60px;
            text-align: center;
            line-height: 60px;
            border: 1px solid transparent;
            border-radius: 4px;
            overflow: hidden;
            background: #fff;
            position: relative;
            box-shadow: 0 1px 1px rgba(0, 0, 0, .2);
            margin-right: 4px;
        }

        .upload-list img {
            width: 100%;
            height: 100%;
        }

        .upload-list-cover {
            display: none;
            position: absolute;
            top: 0;
            bottom: 0;
            left: 0;
            right: 0;
            background: rgba(0, 0, 0, .6);
        }

        .upload-list:hover .upload-list-cover {
            display: block;
        }

        .upload-list-cover i {
            color: #fff;
            font-size: 20px;
            cursor: pointer;
            margin: 0 2px;
        }
    </style>
</head>
<body>
<div id="rrapp" v-cloak>
    <div v-show="showGoodsList">
        <Row :gutter="16">
            <div class="search-group">
                <i-col span="4">
                    <i-input v-model="q.name" @on-enter="query" placeholder="名称"/>
                </i-col>
                <i-button @click="query">查询</i-button>
            </div>
            <div class="buttons-group">
                #if($shiro.hasPermission("goods:save"))
                <i-button type="info" @click="add"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("goods:update"))
                <i-button type="warning" @click="update"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end
                #if($shiro.hasPermission("goods:delete"))
                <i-button type="error" @click="del"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
                <i-button type="primary" @click="enSale"><i class="fa fa-hand-o-up"></i>&nbsp;上架</i-button>
                <i-button type="dashed" @click="unSale"><i class="fa fa-hand-o-down"></i>&nbsp;下架</i-button>
                <!--
                <i-button type="warning" @click="openPro"><i class="fa fa-pencil-square-o"></i>&nbsp;产品</i-button>
                <i-button type="warning" @click="openSpe"><i class="fa fa-pencil-square-o"></i>&nbsp;规格</i-button>
                -->
            </div>
        </Row>
        <table id="goodsGrid"></table>
        <div id="goodsGridPager"></div>
    </div>


    <Steps v-show="!showGoodsList" :current="currentStep">
        <Step title="商品信息" content="录入商品基本信息并上传商品图片" v-click="selectStep0"></Step>
        <Step title="规格设置" content="设置商品的各种规格信息" v-click="selectStep1"></Step>
        <Step title="库存设置" content="针对不同规格设置库存数量"  v-click="selectStep2"></Step>
    </Steps>

    <div v-show="!showGoodsList && currentStep == 0">
        <div style="margin-left: 5px; margin-bottom: 15px">
            <i-button @click="reload"/>《 返回列表页</i-button>
            <i-button @click="selectStep1">下一步 》</i-button>
            <i-button type="primary" @click="handleSubmitAndNext('goods')">提交并下一步 》</i-button>
            <!--<i-button type="ghost" @click="handleReset('formValidate')" style="margin-left: 8px">重置</i-button>-->
        </div>
        <Tabs value="name1">
            <Tab-Pane label="基本信息" name="name1">
                <i-form ref="goods" :model="goods" :rules="ruleValidate" :label-width="180">
                    <Form-item label="销售类型" prop="saleType">
                        <Radio-group v-model="goods.saleType">
                            <Radio label="x">
                                <span>现货</span>
                            </Radio>
                            &nbsp;&nbsp;&nbsp;&nbsp;
                            <Radio label="q">
                                <span>订货</span>
                            </Radio>
                            &nbsp;&nbsp;&nbsp;&nbsp;
                            <Radio label="p">
                                <span>拼单</span>
                            </Radio>
                        </Radio-group>
                    </Form-item>
                    <Form-item label="商品编码" prop="goodsSn">
                        <i-input v-model="goods.goodsSn" placeholder="商品编码"/>
                    </Form-item>
                    <Form-item label="商品名称" prop="name">
                        <i-input v-model="goods.name" placeholder="商品名称"/>
                    </Form-item>
                    <Form-item label="商品类型" prop="categoryNames">
                        <i-select v-model="categoryNames" placeholder="商品类型可多选，可以为当前商品制定多种类型分类" multiple>
                            <i-option v-for="category in categories" :value="category.id" :key="category.id">{{category.name}}</i-option>
                        </i-select>
                    </Form-item>
                    <!--
                    <Form-item label="商品类别" prop="attributeCategory" style="width: 268px;">
                        <i-select v-model="goods.attributeCategory" filterable label-in-value>
                            <i-option v-for="attributeCategory in attributeCategories" :value="attributeCategory.id"
                                      :key="attributeCategory.id">{{attributeCategory.name}}
                            </i-option>
                        </i-select>
                    </Form-item>
                    <Form-item label="品牌" prop="brandId" style="width: 268px;">
                        <i-select v-model="goods.brandId" filterable>
                            <i-option v-for="brand in brands" :value="brand.id" :key="brand.id">{{brand.name}}
                            </i-option>
                        </i-select>
                    </Form-item>
                    <Form-item label="市场价" prop="marketPrice">
                        <Input-number :min="0" :step="1" v-model="goods.marketPrice" placeholder="市场价"
                                      style="width: 188px;"/>
                    </Form-item>
                    <Form-item label="商品库存" prop="goodsNumber">
                        <Input-number :min="0" :step="1" v-model="goods.goodsNumber" placeholder="商品库存"
                                      style="width: 188px;"/>
                    </Form-item>
                    -->
                    <Form-item label="最低访问等级" prop="accessUserGrade">
                        <Radio-group v-model="goods.accessUserGrade">
                            <Radio label="0" v-if="currShop.rootType==3"> <!-- 只有公开零售店才允许设置游客价格 -->
                                <span>游客</span>
                            </Radio>
                            <Radio label="1">
                                <span>普通客户</span>
                            </Radio>
                            <Radio label="2">
                                <span>高级客户</span>
                            </Radio>
                        </Radio-group>
                    </Form-item>
                    <Form-item label="定价策略" prop="priceType">
                        <Radio-group v-model="goods.priceType">
                            <Radio label="0" v-if="currShop.rootType == 0 || currShop.rootType == 1"> <!-- 旗舰店或批发店 -->
                                <span>按下单量设定三级阶梯价格</span>
                            </Radio>
                            <Radio label="2" v-if="currShop.rootType == 0 || currShop.rootType == 1"><!-- 旗舰店或批发店 -->
                                <span>按分摊和成本自动计算价格</span>
                            </Radio>
                            <Radio label="1" v-if="currShop.rootType == 2 || currShop.rootType == 3">
                                <span>按客户等级设定单一价格</span>
                            </Radio>
                        </Radio-group>
                    </Form-item>
                    <!-- 面向游客的价格 -->
                    <Form-item v-if="currShop.rootType == 3 && goods.accessUserGrade < 1" label="游客价格（元）" prop="counterPrice">
                        <i-input v-model="goods.counterPrice" placeholder="请输入游客价格，如：200"/>
                    </Form-item>
                    <Form-item v-if="(currShop.rootType == 2 || currShop.rootType == 3) && goods.accessUserGrade < 2" label="普通客户价格（元）" prop="counterSecPrice">
                        <i-input v-model="goods.counterSecPrice" placeholder="请输入普通客户价格，如：190"/>
                    </Form-item>
                    <Form-item v-if="currShop.rootType == 2 || currShop.rootType == 3" label="高级客户价格（元）" prop="counterThiPrice">
                        <i-input v-model="goods.counterThiPrice" placeholder="请输入高级客户价格，如：180"/>
                    </Form-item>
                    <!-- 面向商家的价格 -->
                    <Form-item v-if="goods.priceType == 0 && goods.accessUserGrade < 2" label="普通客户价格（元）" prop="clientPrice">
                        <i-input v-model="goods.clientPrice" placeholder="请输入普通客户价格，如：190"/>
                    </Form-item>
                    <Form-item v-if="goods.priceType == 0" label="高级客户价格（元）" prop="vipClientPrice">
                        <i-input v-model="goods.vipClientPrice" placeholder="请输入高级客户价格，如：180"/>
                    </Form-item>
                    <Form-item v-if="goods.priceType == 0" label="第二阶梯价格起步量" prop="firstNum" >
                        <i-input v-model="goods.firstNum" placeholder="请输入第二阶梯价格的下单起步量，如：10"/>
                    </Form-item>
                    <Form-item v-if="goods.priceType == 0" label="第二阶梯价格折扣" prop="firstDiscount">
                        <i-input v-model="goods.firstDiscount" placeholder="请输入第二阶梯价格的优惠折扣，如：0.85"/>
                    </Form-item>
                    <Form-item v-if="goods.priceType == 0" label="第三阶梯价格起步量" prop="secondNum">
                        <i-input v-model="goods.secondNum" placeholder="请输入第三阶梯价格的下单起步量，如：20"/>
                    </Form-item>
                    <Form-item v-if="goods.priceType == 0" label="第三阶梯价格折扣" prop="secondDiscount">
                        <i-input v-model="goods.secondDiscount" placeholder="请输入第三阶梯价格起步量的优惠折扣，如：0.75"/>
                    </Form-item>

                    <Form-item v-if="goods.priceType == 2" label="单件分摊成本" prop="singleShareCost" >
                        <i-input v-model="goods.singleShareCost" placeholder="包括打版固定成本分摊、预计生产次数分摊、预计单次生产次数分摊等" @on-change="calcSinglePrice"/>
                    </Form-item>
                    <Form-item v-if="goods.priceType == 2" label="单件生产成本" prop="singleMakeCost" >
                        <i-input v-model="goods.singleMakeCost" placeholder="包括单件材料成本、单件人工成本等" @on-change="calcSinglePrice"/>
                    </Form-item>
                    <Form-item v-if="goods.priceType == 2" label="单件接单成本" prop="singleOrderCost" >
                        <i-input v-model="goods.singleOrderCost" placeholder="包括每次接单处理人工成本等" @on-change="calcSinglePrice"/>
                    </Form-item>
                    <Form-item v-if="goods.priceType == 2" label="单件毛利" prop="singleProfitCost" >
                        <i-input v-model="goods.singleProfitCost" placeholder="请输入单件毛利，作为价格计算的因子之一" @on-change="calcSinglePrice"/>
                    </Form-item>
                    <Form-item v-if="goods.priceType == 2 && goods.accessUserGrade < 2" label="普通客户折扣" prop="firstDiscount">
                        <i-input v-model="goods.firstDiscount" placeholder="请输入普通客户优惠折扣，如：0.85" @on-change="calcSinglePrice"/>
                    </Form-item>
                    <Form-item v-if="goods.priceType == 2" label="高级客户折扣" prop="secondDiscount">
                        <i-input v-model="goods.secondDiscount" placeholder="请输入高级客户优惠折扣，如：0.75" @on-change="calcSinglePrice"/>
                    </Form-item>
                    <Form-item v-if="goods.priceType == 2 && goods.accessUserGrade < 2" label="单件普通客户价格" prop="singleSecPrice" >
                        <i-input v-model="goods.singleSecPrice" placeholder="自动计算：单件分摊成本 + 单件生产成本 + 单次接单成本 / 购买数量（此处为：1） + 单件毛利 * 普通客户折扣" disabled/>
                    </Form-item>
                    <Form-item v-if="goods.priceType == 2" label="单件高级客户价格" prop="singleThiPrice" >
                        <i-input v-model="goods.singleThiPrice" placeholder="自动计算：单件分摊成本 + 单件生产成本 + 单次接单成本 / 购买数量（此处为：1） + 单件毛利 * 高级客户折扣" disabled/>
                    </Form-item>

                    <Form-item v-if="(currShop.rootType == 0 || currShop.rootType == 1) && goods.saleType == 'q'" label="期货上市日期" prop="futuresListingDate">
                        <Date-picker v-model="goods.futuresListingDate" placeholder="期货上市日期"></Date-picker>
                    </Form-item>
                    <Form-item v-if="(currShop.rootType == 0 || currShop.rootType == 1) && goods.saleType == 'q'" label="期货备注说明" prop="futuresMemo">
                        <i-input v-model="goods.futuresMemo" placeholder="期货备注说明"/>
                    </Form-item>
                    <Form-item v-if="(currShop.rootType == 0 || currShop.rootType == 1) && goods.saleType == 'p'" label="拼单起步量" prop="collageMiniNum">
                        <i-input v-model="goods.collageMiniNum" placeholder="请输入拼单生效的最低起步量，如：50"/>
                    </Form-item>
                    <Form-item v-if="(currShop.rootType == 0 || currShop.rootType == 1) && goods.saleType == 'p'" label="拼单截止日期" prop="collageEndDate">
                        <Date-picker v-model="goods.collageEndDate" placeholder="拼单截止日期"></Date-picker>
                    </Form-item>
                    <Form-item v-if="(currShop.rootType == 0 || currShop.rootType == 1) && goods.saleType == 'p'" label="拼单备注说明" prop="collageMemo">
                        <i-input v-model="goods.collageMemo" placeholder="拼单备注说明"/>
                    </Form-item>


                    <!--<Form-item label="商品单位" prop="goodsUnit" style="width: 268px;">-->
                    <!--<i-select v-model="goods.goodsUnit" filterable>-->
                    <!--<i-option v-for="macro in macros" :value="macro.value" :key="macro.value">{{macro.name}}-->
                    <!--</i-option>-->
                    <!--</i-select>-->
                    <!--</Form-item>-->
                    <!--<Form-item label="单价" prop="unitPrice">-->
                    <!--<Input-number :min="0" :step="1" v-model="goods.unitPrice" placeholder="单价"-->
                    <!--style="width: 188px;"/>-->
                    <!--</Form-item>-->

                    <!--<Form-item label="专柜价格" prop="counterPrice">-->
                    <!--<Input-number :min="0" :step="1" v-model="goods.counterPrice" placeholder="专柜价格"-->
                    <!--style="width: 188px;"/>-->
                    <!--</Form-item>-->
                    <!--<Form-item label="附加价格" prop="extraPrice">-->
                    <!--<Input-number :min="0" :step="1" v-model="goods.extraPrice" placeholder="附加价格"-->
                    <!--style="width: 188px;"/>-->
                    <!--</Form-item>-->

                    <!--
                    <Row>
                        <i-col span="16">
                            <Form-item label="商品主图" prop="primaryPicUrl">
                                <i-input v-model="goods.primaryPicUrl" placeholder="商品主图" readonly/>
                            </Form-item>
                        </i-col>
                        <i-col span="3">
                            <Form-item :label-width="1">
                                <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
                                        max-size="2048"
                                        :on-success="handleSuccessPicUrl" :on-format-error="handleFormatError"
                                        :show-upload-list="false"
                                        :on-exceeded-size="handleMaxSize">
                                    <i-button icon="ios-cloud-upload-outline">上传图片</i-button>
                                </Upload>
                            </Form-item>
                        </i-col>
                        <i-col span="3">
                            <Form-item :label-width="1">
                                <i-button icon="eye" @click="eyeImagePicUrl">预览图片</i-button>
                            </Form-item>
                        </i-col>
                    </Row>
                    -->
                    <Row>
                        <i-col span="16">
                            <Form-item label="商品列表图" prop="listPicUrl">
                                <i-input v-model="goods.listPicUrl" placeholder="商品列表图" readonly/>
                            </Form-item>
                        </i-col>
                        <i-col span="3">
                            <Form-item :label-width="1">
                                <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
                                        max-size="2048"
                                        :on-success="handleSuccessListPicUrl" :on-format-error="handleFormatError"
                                        :show-upload-list="false"
                                        :on-exceeded-size="handleMaxSize">
                                    <i-button icon="ios-cloud-upload-outline">上传图片</i-button>
                                </Upload>
                            </Form-item>
                        </i-col>
                        <i-col span="3">
                            <Form-item :label-width="1">
                                <i-button icon="eye" @click="eyeImageListPicUrl">预览图片</i-button>
                            </Form-item>
                        </i-col>
                    </Row>
                    <Form-item label="允许代理" prop="isAllowAgent">
                        <Radio-group v-model="goods.isAllowAgent">
                            <Radio label="1">
                                <span>是</span>
                            </Radio>
                            <Radio label="0">
                                <span>否</span>
                            </Radio>
                        </Radio-group>
                    </Form-item>
                    <Form-item label="是否上架" prop="isOnSale">
                        <Radio-group v-model="goods.isOnSale">
                            <Radio label="1">
                                <span>是</span>
                            </Radio>
                            <Radio label="0">
                                <span>否</span>
                            </Radio>
                        </Radio-group>
                    </Form-item>
                    <Form-item label="是否新品" prop="isNew">
                        <Radio-group v-model="goods.isNew">
                            <Radio label="1">
                                <span>是</span>
                            </Radio>
                            <Radio label="0">
                                <span>否</span>
                            </Radio>
                        </Radio-group>
                    </Form-item>
                    <Form-item label="是否热销" prop="isHot">
                        <Radio-group v-model="goods.isHot">
                            <Radio label="1">
                                <span>是</span>
                            </Radio>
                            <Radio label="0">
                                <span>否</span>
                            </Radio>
                        </Radio-group>
                    </Form-item>
                    <Form-item label="排序" prop="sortOrder">
                        <Input-number :min="0" :step="1" v-model="goods.sortOrder" placeholder="排序"
                                      style="width: 188px;"/>
                    </Form-item>
                    <!--
                    <Form-item label="推广描述" prop="promotionDesc">
                        <i-input v-model="goods.promotionDesc" placeholder="推广描述"/>
                    </Form-item>
                    <Form-item label="关键字" prop="keywords">
                        <i-input v-model="goods.keywords" placeholder="关键字"/>
                    </Form-item>
                    -->
                    <Form-item label="简明介绍" prop="goodsBrief">
                        <i-input v-model="goods.goodsBrief" placeholder="简明介绍"/>
                    </Form-item>
                </i-form>
            </Tab-Pane>
            <Tab-Pane label="详细描述" name="name2">
                <template>
                    <div class="upload-list" v-for="item in uploadList">
                        <template><!--v-if="item.status === 'finished'"-->
                            <img :src="item.imgUrl"/>
                            <div class="upload-list-cover">
                                <Icon type="ios-eye-outline" @click.native="handleView(item.imgUrl)"></Icon>
                                <Icon type="ios-trash-outline" @click.native="handleRemove(item)"></Icon>
                            </div>
                        </template>
                        <template v-else>
                            <Progress v-if="item.showProgress" :percent="item.percentage" hide-info></Progress>
                        </template>
                    </div>
                    <Upload
                            ref="upload"
                            :show-upload-list="false"
                            :on-success="handleSuccess"
                            :format="['jpg','jpeg','png']"
                            :max-size="256"
                            :on-format-error="handleFormatError"
                            :on-exceeded-size="handleMaxSize"
                            :before-upload="handleBeforeUpload"
                            multiple
                            type="drag"
                            action="../sys/oss/upload"
                            style="display: inline-block;width:58px;">
                        <div style="width: 58px;height:58px;line-height: 58px;">
                            <Icon type="camera" size="20"></Icon>
                        </div>
                    </Upload>
                    <Modal title="查看图片" v-model="visible">
                        <img :src="imgName" v-if="visible" style="width: 100%"/>
                    </Modal>
                </template>
                <Row>
                    温馨提示：如需控制上传图片显示先后顺序，请在文件名后附上“##”+数字，例如：P#2.jpg，则系统会自动对文件排序。
                </Row>
                <div id="goodsDesc"></div>
            </Tab-Pane>
        </Tabs>
    </div>


    <div v-show="!showGoodsList && currentStep == 1 && !showGoodsspecificationModal" style="margin-left: 15px;">
        <Row :gutter="16">
            <div class="search-group">
                <i-button @click="reload"/>《 返回列表页</i-button>
                <i-button @click="selectStep0">《 上一步</i-button>
                <i-button @click="selectStep2">下一步 》</i-button>
            </div>
            <div class="buttons-group">
                #if($shiro.hasPermission("goodsspecification:save"))
                <i-button type="info" @click="addGoodsspecification"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("goodsspecification:update"))
                <i-button type="warning" @click="updateGoodsspecification"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end
                #if($shiro.hasPermission("goodsspecification:delete"))
                <i-button type="error" @click="delGoodsspecification"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
            </div>
        </Row>
        <table id="goodsSpecificationGrid"></table>
        <div id="goodsSpecificationGridPager"></div>
    </div>
    <Card v-show="!showGoodsList && currentStep == 1 && showGoodsspecificationModal">
        <p slot="title">{{titleGoodsspecification}}</p>
        <i-form ref="goodsspecificationFormValidate" :model="goodsSpecification" :label-width="120">
            <Form-item label="商品名称">
                {{goods.name}}
            </Form-item>
            <Form-item label="规格项" prop="goodsspecificationId">
                <i-select v-model="goodsSpecification.specificationId">
                    <i-option v-for="specification in specifications" :value="specification.id" :key="specification.id">{{specification.name}}</i-option>
                </i-select>
            </Form-item>
            <Form-item label="规格值" prop="goodsspecificationValue">
                <i-input v-model="goodsSpecification.value" placeholder='如规格项是“颜色”，则规格值填写“红色”'/>
            </Form-item>
            <Row>
                <i-col span="16">
                    <Form-item label="规格图片" prop="picUrl">
                        <i-input v-model="goodsSpecification.picUrl" placeholder="设置规格图片用于移动端购物时展示规格图片" readonly/>
                    </Form-item>
                </i-col>
                <i-col span="3">
                    <Form-item :label-width="1">
                        <Upload style="width: 300px;" action="../sys/oss/upload" :format="['jpg','jpeg','png']"
                                max-size="128"
                                :on-success="handleGoodsSpecificationSuccess" :on-format-error="handleGoodsSpecificationFormatError"
                                :show-upload-list="false"
                                :on-exceeded-size="handleGoodsSpecificationMaxSize">
                            <i-button icon="ios-cloud-upload-outline">上传图片</i-button>
                        </Upload>
                    </Form-item>
                </i-col>
                <i-col span="3">
                    <Form-item :label-width="1">
                        <i-button icon="eye" @click="eyeGoodsSpecificationImage">预览图片</i-button>
                    </Form-item>
                </i-col>
            </Row>
            <Form-item>
                <i-button @click="reloadGoodsSpecificationGrid" style="margin-left: 8px"/>返回</i-button>
                <i-button type="primary" @click="saveOrUpdateGoodsspecification">提交并返回</i-button>
            </Form-item>
        </i-form>
    </Card>

    <div v-show="!showGoodsList && currentStep == 2 && !showProductModal" style="margin-left: 15px;">
        <Row :gutter="16">
            <div class="search-group">
                <i-button @click="reload"/>《 返回列表页</i-button>
                <i-button @click="selectStep1">《 上一步</i-button>
            </div>
            <div class="buttons-group">
                #if($shiro.hasPermission("product:save"))
                <i-button type="info" @click="addProduct"><i class="fa fa-plus"></i>&nbsp;新增</i-button>
                #end
                #if($shiro.hasPermission("product:update"))
                <i-button type="warning" @click="updateProduct"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</i-button>
                #end
                #if($shiro.hasPermission("product:delete"))
                <i-button type="error" @click="delProduct"><i class="fa fa-trash-o"></i>&nbsp;删除</i-button>
                #end
            </div>
        </Row>
        <table id="productGrid"></table>
        <div id="productGridPager"></div>
    </div>
    <Card v-show="!showGoodsList && currentStep == 2 && showProductModal">
        <p slot="title">{{titleProduct}}</p>
        <i-form ref="formValidate" :model="product" :label-width="120">
            <Form-item label="商品名称" prop="goodsId" v-if="productOpsType == 'update'">
                {{vm.product.goodsName}}
            </Form-item>
            <Form-item label="商品序列号" prop="goodsSn">
                <i-input v-model="product.goodsSn" placeholder="商品序列号" style="width: 600px;"/>
            </Form-item>
            <Form-item label="商品规格" prop="goodsSpecificationIds" v-if="productOpsType == 'add' && productSpecifications.length > 0">
                <Checkbox-group v-model="productSelectedSpecification" @on-change="getProductSpecificationItems">
                    <Checkbox v-for="specification in productSpecifications" :value="specification.id" :key="specification.id" :label="specification.id">{{specification.name}}</Checkbox>
                </Checkbox-group>
            </Form-item>
            <Form-item v-for="(specification,index) in productSpecifications" :key="index" :label="specification.name" v-if="productOpsType == 'add' && productSelectedSpecification.indexOf(specification.id)>-1">
                <i-select v-model="productPartSpecifications[index]" style="width: 600px;">
                    <i-option v-for="item in productSpecificationItems[index]" :value="item.id" :key="item.id">{{item.value}}</i-option>
                </i-select>
            </Form-item>
            <Form-item label="商品规格" prop="goodsSpecificationIds" v-if="productOpsType == 'update'">
                {{vm.product.specificationsName}}
            </Form-item>
            <Form-item label="商品库存数" prop="goodsNumber" v-if="productOpsType == 'add' && productSpecifications && productSelectedSpecification && productSpecifications.length == productSelectedSpecification.length && productSelectedSpecification.length > 0">
                <Input-number :min="0" :step="1" v-model="product.goodsNumber" placeholder="商品库存数" style="width: 600px;"/>
            </Form-item>
            <Form-item label="商品库存数" prop="goodsNumber" v-if="productOpsType == 'update'">
                <Input-number :min="0" :step="1" v-model="product.goodsNumber" placeholder="商品库存数" style="width: 600px;"/>
            </Form-item>
            <!--
            <Form-item label="零售价格" prop="retailPrice">
                <Input-number :min="0" :step="1" v-model="product.retailPrice" placeholder="零售价格"
                              style="width: 188px;"/>
            </Form-item>
            <Form-item label="市场价格" prop="marketPrice">
                <Input-number :min="0" :step="1" v-model="product.marketPrice" placeholder="市场价格"
                              style="width: 188px;"/>
            </Form-item>
            -->
            <Form-item>
                <i-button @click="reloadProductGrid" style="margin-left: 8px"/>返回</i-button>
                <i-button type="primary" @click="handleProductSubmit('formValidate')">提交并返回</i-button>
            </Form-item>
        </i-form>
    </Card>

</div>

<script src="${rc.contextPath}/js/shop/goods.js?_${date.systemTime}"></script>
</body>
</html>